package com.practice.stream.entity;

import lombok.*;

import java.util.Objects;

/**
 * @author hd
 * @date 2022/1/29 16:42
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Transaction {
    private Trader trader;
    private Integer year;
    private Double money;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Transaction that = (Transaction) o;
        return Objects.equals(trader, that.trader) && Objects.equals(year, that.year) && Objects.equals(money, that.money);
    }

    @Override
    public int hashCode() {
        return Objects.hash(trader, year, money);
    }
}
